//
// Created by abstergo on 24-6-15.
//

#ifndef TBS_CPP_MATCHSTRUCT_CUH
#define TBS_CPP_MATCHSTRUCT_CUH
template<typename V, typename T>
bool MatchStruct::operator()(V q, T i) {
  static_assert(has_equal_operator<decltype(i), V>::value, "param must has equal operator with V");
  static_assert(has_none_return_method_operator<decltype(i), V>::value,
				"param must has method operator with V");
  if (i == q) {
	i(q);
	return true;
  }
  return false;
}

template<typename M>
template<typename V, typename T>
bool MatcherStruct<M>::operator()(V q, T i) {
  if (i == q) {
	_matched = true;
	if (_method != nullptr) {
	  _method(i);
	}
	return true;
  }
  return false;
}
#endif //TBS_CPP_MATCHSTRUCT_CUH
